import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
// import dataV from '@jiaminghi/data-view'
import moment from 'moment'
// import "font-awesome/css/font-awesome.min.css"
Vue.prototype.$moment = moment

// 按需引入vue-awesome图标
// import Icon from 'vue-awesome/components/Icon'
// import 'vue-awesome/icons/chart-bar.js'
// import 'vue-awesome/icons/chart-area.js'
// import 'vue-awesome/icons/chart-pie.js'
// import 'vue-awesome/icons/chart-line.js'
// import 'vue-awesome/icons/align-left.js'

import getTime from "@/assets/js/getTime.js";
var rem = require('@/assets/js/rem')
rem.setFontSize()
Vue.prototype.$getTime = getTime;
// 引入echart
// 4.x 引用方式
// import * as echarts from 'echarts';//引入echarts
import Directives from '@/assets/directives/index'
import commonJs from '@/utils/commonJs'
import dict from '@/utils/dict'
import permissionUtil from '@/assets/directives/permissionUtil'
Vue.use(Directives)
Vue.config.productionTip = false
// Vue.prototype.$echarts = echarts
Vue.prototype.$permissionUtil = permissionUtil
Vue.prototype.$commonJs = commonJs
Vue.prototype.$dict = dict
Vue.prototype.$yearInputWidth = '96%'
Vue.prototype.$commonBac = 'rgba(240, 248, 253,0.6)'


Vue.prototype.$formatter =  (number)=> {
  if(!number || number===0){
    return number;
  }
  let pointAfter = '';
  if(number.toString().indexOf('.')!==-1){
    pointAfter = number.toString().indexOf('.')!==-1?'.'+number.toString().split('.')[1]:"";
    number = parseInt(number.toString().split('.')[0])
  }
  const numbers = number.toString().split('').reverse()
  const segs = []

  while (numbers.length) segs.push(numbers.splice(0, 3).join(''))

  return segs.join(',').split('').reverse().join('')+pointAfter
}

// Vue.use(dataV)
Vue.use(ElementUI);


new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
